class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        unordered_map<int,int> mp;
        for(int i=0;i<nums.size();i++){
            auto x=mp.find(target-nums[i]);
            if(x!=mp.end()){
                return {i,x->second};
            }
            mp[nums[i]] = i;
        }
        
    return {};
    }
};